﻿using System;
using System.Collections.Generic;
using Pay.TO;

namespace Pay.DTO {
	/// <summary>
	/// 订单表：mc_Order
	/// </summary>
	[Serializable]
	public class order_dto {
        /// <summary>
        /// 
        /// </summary>
		public order_dto() {
			order_items = new List<order_item_dto>();
			binds = new List<bind_merchant_item>();
			pay_info = new pay_info_dto();
		}
		/// <summary>
		/// 订单id
		/// </summary>
		public long id { get; set; }
		/// <summary>
		/// 单号:app传
		/// </summary>
		public string order_no { get; set; }
		/// <summary>
		/// 支付信息
		/// </summary>
		public long pay_id { get; set; }
		/// <summary>
		/// 商户id
		/// </summary>
		public long merchant_id { get; set; }
		/// <summary>
		/// 卖家编号ex
		/// </summary>
		public string merchant_no { get; set; }
		/// <summary>
		/// 分销id
		/// </summary>
		/// <value>The distribution identifier.</value>
        public long? distribution_id { get; set; }
        /// <summary>
        /// 来源店铺id
        /// </summary>
        public long shop_id { get; set; }
        /// <summary>
        /// 支付商户id
        /// </summary>
        public long? buy_id { get; set; }
		/// <summary>
		/// 买家留言:app传
		/// </summary>
		public string remark { get; set; }
        /// <summary>
        /// 商家（卖家）备注
        /// </summary>
        public string merchant_remark { get; set; }
        /// <summary>
        /// 配送方式 1：物流，2：到店拿货，3：送货上门，4：无配送
        /// </summary>
        public int shipping_type { get; set; }
		/// <summary>
		/// 订单时间
		/// </summary>
		public DateTime order_time { get; set; }
		/// <summary>
		/// 订单完成时间
		/// </summary>
		public DateTime? finish_time { get; set; }
		/// <summary>
		/// 订单状态:1待支付，2待发货，3已完成，4已取消
		/// </summary>
		public OrderStatus status { get; set; }
        /// <summary>
        /// 是否买家已删除
        /// </summary>
        public bool is_buy_del { get; set; }
        /// <summary>
        /// 是否卖家删除
        /// </summary>
        public bool is_seller_del { get; set; }
        /// <summary>
        /// 订单结算状态
        /// </summary>
        public OrderSettleStatus order_settle_status { get; set; }
		/// <summary>
		/// 优惠名称:app传
		/// </summary>
		public string discount_name { get; set; }
		/// <summary>
		/// 优惠金额:app传
		/// </summary>
		public decimal discount_amount { get; set; }
		/// <summary>
		/// 运费:app传
		/// </summary>
		public decimal freight { get; set; }
		/// <summary>
		/// 赠送积分
		/// </summary>
		public int points { get; set; }
		/// <summary>
		/// 三级分销总金额
		/// </summary>
		/// <value>The dis amount.</value>
		public decimal disAmount { get; set; }
		/// <summary>
		/// 订单金额＝价格×数量＋运费+税费
		/// </summary>
		public decimal order_amount { get; set; }
		/// <summary>
		/// 税费
		/// </summary>
		public decimal tax { get; set; }
		/// <summary>
		/// 兑换积分
		/// </summary>
		public int integral { get; set; }
        /// <summary>
        /// 红砖数量
        /// </summary>
        public decimal red_drill { get; set; }
        /// <summary>
        /// 积分抵扣金额＝sum商品(积分抵扣金额):app传
        /// </summary>
        public decimal integral_discount { get; set; }
		/// <summary>
		/// 应付金额=订单金额-优惠-积分抵扣金额:app传
		/// </summary>
		public decimal pay_amount { get; set; }
		/// <summary>
		/// 手续费=应付金额×商户的费率
		/// </summary>
		public decimal fee_amount { get; set; }
        /// <summary>
        /// 国内运费
        /// </summary>
        public decimal? post_fee { get; set; }
        /// <summary>
        /// 国外运费
        /// </summary>
        public decimal? sino_fee { get; set; }
        /// <summary>
        /// 卖家费率
        /// </summary>
        public decimal fee { get; set; }
		/// <summary>
		/// 卖家实收金额＝应付金额－手续费-分销
		/// </summary>
		public decimal amount { get; set; }
        /// <summary>
        /// 商家电话
        /// </summary>
        public string mobile { get; set; }
        /// <summary>
        /// 订单来源类型：1海淘乐，2候鸟 6集市 7人脸认证
        /// </summary>
        public int? order_type { get; set; }
        /// <summary>
        /// 分销与积分抵扣金额分配集合，如果是时代云商的会积分消费，此时金额中会有负数，是减使用着的冻结金额并加到卖家实收金额里，可空:app传
        /// </summary>
        public List<bind_merchant_item> binds { get; set; }
		/// <summary>
		/// 商户
		/// </summary>
		public merchant_dto merchant { get; set; }
		/// <summary>
		/// 买家
		/// </summary>
		public merchant_dto buyer { get; set; }
        /// <summary>
        /// 分销用户
        /// </summary>
        public merchant_dto dis_user { get; set; }
		/// <summary>
		/// 订单配送
		/// </summary>
		public shipping_dto shipping { get; set; }
		/// <summary>
		/// 订单明细
		/// </summary>
		public List<order_item_dto> order_items { get; set; }
		/// <summary>
		/// 支付信息
		/// </summary>
		public pay_info_dto pay_info { get; set; }
        /// <summary>
        /// 接收红砖账户id
        /// </summary>
        public long? red_drill_receiver_id { get; set; }
        /// 订单推送状态
        /// </summary>
        public OrderPushStatus push_status { get; set; }
        /// <summary>
        /// 推送返回信息
        /// </summary>
        public string push_fail_msg { get; set; }

    }

    public class order_dto_ex {
        /// <summary>
        /// 单号
        /// </summary>
        public string order_no { get; set; }
        /// <summary>
        /// 快递代码
        /// </summary>
        public string express_no { get; set; }
        /// <summary>
        /// 快递公司
        /// </summary>
        public string express_company_name { get; set; }
        /// <summary>
        /// 物流订单号
        /// </summary>
        public string ship_order_number { get; set; }
    }
    /// <summary>
    /// 订单退款
    /// </summary>
    public class order_refund_dto {
        /// <summary>
        /// 
        /// </summary>
        public long id { get; set; }
        /// <summary>
        /// 退货/退款单号
        /// </summary>
        public string order_refund_no { get; set; }
        /// <summary>
        /// 订单id
        /// </summary>
        public long order_id { get; set; }
        /// <summary>
        /// 金额
        /// </summary>
        public decimal amount { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string remark { get; set; }
        /// <summary>
        /// 操作状态
        /// </summary>
        public OrderRefundStatus status { get; set; }
        /// <summary>
        /// 受理类型
        /// </summary>
        public OrderRefundType type { get; set; }
        /// <summary>
        /// 操作人
        /// </summary>
        public long merchant_id { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime create_time { get; set; }
        /// <summary>
        /// 处理时间
        /// </summary>
        public DateTime handle_time { get; set; }
    }
 }